﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace CNFM_CROCODILE_LOGO.RestClient.Domain
{
    public static class UserBasic
    {

        public static string userId { get; set; }

        public static string url { get; set; }

        public static string enterpriseRoId { get; set; }

        public static string enterpriseId { get; set; }
        /// <summary>
        /// 用户Id
        /// </summary>
        /// <returns></returns>
        public static string UserId()
        {
            return userId;
        }

        /// <summary>
        /// 企业角色Id
        /// </summary>
        /// <returns></returns>
        public static string EnterpriseRoId()
        {
            return enterpriseRoId;
        }

        /// <summary>
        /// 企业Id
        /// </summary>
        /// <returns></returns>
        public static string EnterpriseId()
        {
            return enterpriseId;
        }

        /// <summary>
        /// 地址
        /// </summary>
        /// <returns>Microsoft.Extensions.Configuration.FileExtensions,Microsoft.Extensions.Configuration.Json</returns>
        public static string Url()
        {
            IConfiguration configuration = new ConfigurationBuilder()
                 .SetBasePath(Directory.GetCurrentDirectory())
              .AddJsonFile("appsettings.json").Build();

            //string connectionString = configuration["DBSetting:DefaultConnection"];

            //string connectionStrings = configuration["UrlSetting:DefaultConnection"];

            return configuration["UrlSetting:DefaultConnection"].ToString();
        }
    }
}
